package com.qf.kdgroup.gdbackend.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResultBean<T> {

    private Integer code;
    private String message;
    private T data;



    public static ResultBean success(){
        return new ResultBean(1000,"success",null);
    }

    public static ResultBean success(String message,Object data){
        return new ResultBean(1000,message,data);
    }

    public static ResultBean success(Object object){
        return new ResultBean(1000,"success",object);
    }


    public static ResultBean error(){
        return new ResultBean(700,"error",null);
    }

    public static ResultBean error(String message){
        return new ResultBean(700,message,null);
    }






}
